#{extends 'main.html' /}
#{set title:'Answers Overview' /}
#{set 'moreScripts'}
    <script src="@{'/public/javascripts/jquery.dataTables.min.js'}" type="text/javascript" charset="${_response_encoding}"></script>
    <script>
        $(document).ready( function() {
            oTable = $('.answerTable').dataTable();
        });
    </script>
#{/set}

#{navigation /}

<div class="content">
		<h1>Answered Questions</h1>
	
	<div style="width: 80%; margin: auto">
		<table cellpadding="0" cellspacing="0" border="0" class="answerTable" id="answerTable">
			<thead>
				<tr><th>Title</th><th>No of Answers</th><th>Lecture</th></tr>
			</thead>
			<tbody>
				#{list questions, as:'question'}
					<tr><td><a href="@{Answers.show(question.id)}">${question.title}</a></td><td>${question.answers.size()}</td><td><a href="@{Lectures.show(question.lecture.id)}">${question.lecture.name}</a></td></tr>
				#{/list}
			</tbody>
		</table>
	</div>
</div>